package com.linkoog.devtools.code_generator.common;

import com.intellij.notification.Notification;
import com.intellij.notification.NotificationType;
import com.intellij.notification.Notifications;
import com.intellij.openapi.ui.popup.Balloon;

/**
 * @author Administrator
 * @since 2017/4/27
 */
public class MessageNotification {

    private static final String GROUP_ID = "DevTools-CodeGen";

    // 日志的前缀
    private static final String TITLE = "DevTools-CodeGen";

    /**
     * Print log to "Event Log"
     */
    public static void infoNotify(String msg) {
        Notification notification = new Notification(GROUP_ID, TITLE, msg, NotificationType.INFORMATION);
        Notifications.Bus.notify(notification);
        Balloon balloon = notification.getBalloon();
        if (balloon != null) {
            balloon.hide(true);
        }
    }
}
